import { DictionaryApi } from '@/api'
import CommonModel from './common'

class DictionaryModel extends CommonModel {
    constructor() {
        super()
        this.api = new DictionaryApi()
    }

    getList(form, page) {
        const data = { ...form, ...page }
        return this.api.getList(data)
    }

    // 字典子项列表
    getSubList(form, page) {
        const data = { ...form, ...page }
        return this.api.getSubList(data)
    }

    // 获取已经启用的所有字典子项
    getTypes(id) {
        return this.api.getTypes({ code: id })
    }

    // 设置启用禁用
    setStatus(data) {
        return this.api.setStatus(data)
    }
}

export default DictionaryModel
